package fivm.cross.platform.steamobj.appcase.params;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import fivm.cross.platform.ficommon.distinguish.GsonSimpleSerializable;

/**
 * Created by Administrator on 2016/5/11.
 */
public class FiServerTelephonyManager extends GsonSimpleSerializable {
    @Expose @SerializedName("DeviceId")
    private String DeviceId;
    @Expose @SerializedName("NetworkType")
    private int NetworkType;
    @Expose @SerializedName("SimOperator")
    private String SimOperator;
    @Expose @SerializedName("SubscriberId")
    private String SubscriberId;    //imsi


    public static String genImei() {// calculator IMEI 生成一个imei
        int r1 = 1000000 + new java.util.Random().nextInt(9000000);
        int r2 = 1000000 + new java.util.Random().nextInt(9000000);
        String input = r1 + "" + r2;
        char[] ch = input.toCharArray();
        int a = 0, b = 0;
        for (int i = 0; i < ch.length; i++) {
            int tt = Integer.parseInt(ch[i] + "");
            if (i % 2 == 0) {
                a = a + tt;
            } else {
                int temp = tt * 2;
                b = b + temp / 10 + temp % 10;
            }
        }
        int last = (a + b) % 10;
        if (last == 0) {
            last = 0;
        } else {
            last = 10 - last;
        }
        return input + last;
    }
    public static String genImsi() {
        // 460022535025034
        String title = "4600";
        int second = 0;
        do {
            second = new java.util.Random().nextInt(8);
        } while (second == 4);
        int r1 = 10000 + new java.util.Random().nextInt(90000);
        int r2 = 10000 + new java.util.Random().nextInt(90000);
        return title + "" + second + "" + r1 + "" + r2;
    }

    public void setDeviceId(String deviceId) {
        DeviceId = deviceId;
    }
    public String getDeviceId() {
        return DeviceId;
    }
    public int getNetworkType() {
        return NetworkType;
    }

    public void setNetworkType(int networkType) {
        NetworkType = networkType;
    }

    public String getSimOperator() {
        return SimOperator;
    }

    public void setSimOperator(String simOperator) {
        SimOperator = simOperator;
    }

    public String getSubscriberId() {
        return SubscriberId;
    }

    public void setSubscriberId(String subscriberId) {
        SubscriberId = subscriberId;
    }
}
